import request from 'common/request.js'

/**
 * 数据字典
 */
export function getDict(parameter) {
  return request({
    url: '/sys/dict?type=' + parameter,
    method: 'post',
    data: {}
  })
}

/**
 * 登陆
 */
export function login(parameter) {
  return request({
    url: '/K3Cloud/Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc',
    method: 'post',
    data: parameter
  })
}

/**
 * 单据查询
 * --物料信息查询
 * --组织查询
 * --客户查询
 * --销售订单查询
 * --仓库查询
 */
export function getMaterialInformation(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * 是否开发票数据
 */
export function getOrderInvoice(parameter, header = {}) {
  return request({
    // url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseQuantity.ExecuteAssistant',
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseQuantity.ExecuteAssistant,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * 默认业务员
 */
export function getOrderSalesman(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseQuantity.ExecuteOperator,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * 业务员列表
 */
export function getOrderSalesmanList(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseQuantity.ExecuteOperatorList,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * 销售订单详情查询
 */
export function getOrderDetail(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.BillQuery.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --物料信息查询
 */
export function getExecuteService(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseQuantity.ExecuteService,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    contentType: 'application/x-www-form-urlencoded',
    header,
  })
}

/**
 * --物料信息查询汇总
 */
export function getExecuteServiceAll(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseQuantity.ExecuteSumService,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    contentType: 'application/x-www-form-urlencoded',
    header,
  })
}

/**
 * --查询仓位信息
 */
export function getPositionInfo(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseStockorg.ExecuteService,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --根据商品条形码和仓库获取仓位信息
 */
export function getPositionInfoByGoodsAnWarehouse(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseStockorg.ExecuteStock,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --根据仓位和仓库获取仓位
 */
export function getPositionInfoByStockLocAnWarehouse(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseStockorg.ExecuteStockLoc,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --下单
 */
export function dynamicFormServiceSave(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --生成入库单
 */
export function dynamicFormServicePush(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Push.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --入库单提交审核
 */
export function dynamicFormServiceSubmit(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.submit.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --仓位同步
 */
export function synchronousWarehouse(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseStockorg.SyncStoloc,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --物料图片-fileId
 */
export function getExecuteServiceImg(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseQuantity.ExecuteImage,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --物料图片-base
 */
export function getBaseImg(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.AttachmentDownLoad.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --报表接口
 */
export function reportDate(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseQuantity.ExecuteSalDemo,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --删除订单接口
 */
export function orderDelete(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Delete.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --UploadFile
 */
export function UploadFile(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.UploadFile.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --物料图片上传
 */
export function getExecuteSaveImage(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.UseStockorg.ExecuteSaveImage,Kingdee.BOS.TestPlugIn.WebApi.BusinessPlugIn.common.kdsvc',
    method: 'post',
    data: parameter,
    // contentType: 'application/x-www-form-urlencoded',
    header,
  })
}

/**
 * --货位调整-提交
 */
export function adjustmentFormServiceSave(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Submit.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}

/**
 * --货位调整-审核
 */
export function adjustmentFormServiceAudit(parameter, header = {}) {
  return request({
    url: '/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Audit.common.kdsvc',
    method: 'post',
    data: parameter,
    header,
  })
}
